using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class GuarApprovedPaymentMap : EntityTypeConfiguration<GuarApprovedPayment>
    {
        public GuarApprovedPaymentMap()
        {
            // Primary Key
            this.HasKey(t => t.Bill_);

            // Properties
            this.Property(t => t.Guar_id)
                .HasMaxLength(6);

            this.Property(t => t.Bill_)
                .IsRequired()
                .HasMaxLength(8);

            // Table & Column Mappings
            this.ToTable("GuarApprovedPayment");
            this.Property(t => t.Payment_id).HasColumnName("Payment_id");
            this.Property(t => t.Guar_id).HasColumnName("Guar_id");
            this.Property(t => t.Pay_date).HasColumnName("Pay_date");
            this.Property(t => t.Bill_).HasColumnName("Bill#");
            this.Property(t => t.Amount_Paid).HasColumnName("Amount_Paid");
        }
    }
}
